Page({
  data: {
    motto: 'Hello World',
    userInfo: {},
    hasUserInfo: false,
    canIUse: wx.canIUse('button.open-type.getUserInfo')
  },
   bindGetUserInfo:function(e){
	   if(e.detail.userInfo)
	   {console.log(e.detail.userInfo),
	getApp().globalData.userInfo = e.detail.userInfo,
	wx.switchTab({
	   url:"pages/index/index"})}
	   else{
		   wx.showmodal({
			   title:"警告",
			   content:"您点击了拒绝授权，无法进入小程序，请授权之后再进入",
			   showCancel:false,
			   confirmtext:"返回授权",
			   success:function(res){
				   if(res.confirm)
				   {
					   console.log("用户点击了返回授权")
				   }
			   }
			   
		   })
	   }
	   
  
  },
})